if __name__ == '__main__':
    # step1 输出乘法表中的一个单元
    # print("1 * 1 = 1")
    # 利用格式化输出修改其输出格式
    # print("1 * 1 = %-2d" % (1))

    # # step2 将 step1 中内容重复九次扩展成一行九列
    # column = 1
    # while column <= 9:
    #     print("1 * 1 = %-2d" % (1), end=" ")
    #     column += 1

    # # step3 调整 step2 中的内容，将第一个数使用循环变量表示
    # column = 1
    # while column <= 9:
    #     print("%d * 1 = %-2d" % (column, column * 1), end=" ")
    #     column += 1

    # # step4 将 step3 中形成的一行九列扩展成九行九列
    # row = 1
    # while row <= 9:
    #     column = 1
    #     while column <= 9:
    #         print("%d * 1 = %-2d" % (column, column * 1), end=" ")
    #         column += 1
    #     print()
    #     row += 1

    # # step 5 调整 step4 中的内容，将第二个数使用循环变量表示
    # row = 1
    # while row <= 9:
    #     column = 1
    #     while column <= 9:
    #         print("%d * %d = %-2d" % (column, row, column * row), end=" ")
    #         column += 1
    #     print()
    #     row += 1

    # step6 调整 step4 中的内容，将第一个数永远小于等于第二个数
    row = 1
    while row <= 9:
        column = 1
        while column <= row:
            print("%d * %d = %-2d" % (column, row, column * row), end=" ")
            column += 1
        print()
        row += 1
